<!doctype HTML>
<html>
<!-- include A-Frame obviously -->
<script src="./static/js/aframe.min.js"></script>
<!-- include ar.js for A-Frame -->
<script src="./static/js/aframe-ar.js"></script>
<!-- include A-Frame-Extras -->
<script src="./static/js/aframe-extras.min.js"></script>



<script src="./static/vConsole-dev/dist/vconsole.min.js"></script>
<script src="./static/js/jquery-3.5.1.js"></script>
<script>
  // 初始化vConsole
  window.vConsole = new window.VConsole();
</script>

<body style='margin : 0px; overflow: hidden;'>

  <script>
    console.log('开始')
    AFRAME.registerComponent('registerevents', {
      init: function () {
        console.log('init1111111111111111111111111111111111');
        var marker = this.el;
        marker.setAttribute('emitevents', 'true');
        marker.addEventListener('markerFound', function () {
          console.log('markerFound22222222222222222222222');
          var markerId = marker.id;
          console.log('markerFound', markerId);
        });
        marker.addEventListener('markerLost', function () {
          console.log('markerLost333333333333333333333333333');
          var markerId = marker.id;
          console.log('markerLost', markerId);
        });
      }
    });
  </script>


  <a-scene embedded arjs id='box'>
    <!-- 房子 -->
    <a-marker preset='custom' type='pattern' url='./static/marker/pattern-2.patt' class="marker" name="house">
      <!-- <a-entity gltf-model="/static/gltf/scene.gltf" animation-mixer scale="1 1 1" rotation="-120 0 0" position="0 0.5 0"></a-entity> -->
      <a-entity rotation="-90 0 0">
        <a-entity gltf-model="./static/gltf/house/scene.gltf" scale="0.5 0.5 0.5" rotation="0 0 0" position="0 0 0"
          class="entity">
        </a-entity>
        <!-- <a-animation attribute="rotation" dur="10000" to="0 360 0" repeat="indefinite"></a-animation> -->
      </a-entity>
    </a-marker>

    <!-- 怪兽 -->
    <a-marker preset='custom' type='pattern' url='./static/marker/pattern-marker.patt' class="marker" name="guaishou">
      <a-entity gltf-model="./static/gltf/scene.gltf" scale="1.5 1.5 1.5" rotation="-160 0 0" position="0 0.5 0"
        class="entity">
      </a-entity>
    </a-marker>

    <!-- add camera -->
    <a-entity camera></a-entity>
  </a-scene>
</body>
<!-- <script src="./static/js/touch.js"></script> -->

</html>